import request from '../util/request'


/*获取附近商铺*/
export function getShops(params){
  return request({
    method: 'get',
    url: 'shopping/restaurants',
    params
  })
} 

/*获取商铺分类*/ 
export function getShopCates(params){
  return request({
    method: 'get',
    url: 'shopping/v2/restaurant/category',
    params
  })
}
/*获取配送方式*/ 
export function getShopDeliveryModes(params){
  return request({
    method: 'get',
    url: 'shopping/v1/restaurants/delivery_modes',
    params,
  })
}



/*获取商家活动属性*/
export function getShopActivityAttrs(params){
  return request({
    method: 'get',
    url: 'shopping/v1/restaurants/activity_attributes',
    params,
  })
}


/*获取商家详情*/
export function getShopInfo(shopId){
  return request({
    method: 'get',
    url: 'shopping/restaurant/'+shopId
  })
}

/*获取商家商品列表*/
export function getShopFoods(shopId){
  return request({
    method: 'get',
    url: '/shopping/v2/menu',
    params:{restaurant_id:shopId}
  })
}


/*获取商家评价分数*/
export function getRateScores(restaurant_id){
  return request({
    method: 'get',
    url: `ugc/v2/restaurants/${restaurant_id}/ratings/scores`,
  })
}

/*获取商家评价分类*/
export function getRateTags(restaurant_id){
  return request({
    method: 'get',
    url: `ugc/v2/restaurants/${restaurant_id}/ratings/tags`,
  })
}


/*获取商家评价信息*/
export function getRateComments(restaurant_id,params){
  return request({
    method: 'get',
    url: `ugc/v2/restaurants/${restaurant_id}/ratings`,
    params
  })
}


/*搜索商铺*/
export function getShopsByKeyword(params){
  return request({
    method: 'get',
    url: 'v4/restaurants',
    params
  })
}

